<?php
if(empty($buid))
	msg($config['weburl']."/login.php","请先登录");
include_once("$config[webroot]/module/product/includes/plugin_orderadder_class.php");
$orderadder=new orderadder();


if(!empty($_POST['act'])&&empty($_POST['name'])&&empty($_POST['province'])&&empty($_POST['city'])&&empty($_POST['address'])&&empty($_POST['zip']))
	$admin->msg($config['weburl'].'/main.php?action=m&m=product&s=admin_orderadder&menu=info','操作失败');

//--增加收货地址
if(!empty($_POST['submit'])&&$_POST['act']=='sumit')
{   
	$flag=$orderadder->add_orderadder(); 
	$admin->msg($config['weburl'].'/main.php?action=m&m=product&s=admin_orderadder&menu=info','不能超过5条');      
}
//--修改收货地址
if(!empty($_POST['submit'])&&$_POST['act']=='edit')
	$orderadder->edit_orderadder($_POST['edid']);  
//--删除收货地址
if(!empty($_GET['edid'])&&is_numeric($_GET['edid']))
	$orderadder->del_orderadder($_GET['edid']);  

//--显示收货地址
if(!empty($_GET['id'])&&is_numeric($_GET['id']))
{
	$tpl->assign("de",$orderadder->get_orderadder($_GET['id']));
}	
$tpl->assign("list",$orderadder->get_orderadderlist());
//---------------------------------
$tpl->assign("config",$config);
$tpl->assign("prov",get_province($de['province']));
$tpl->assign("lang",$lang);
$output=tplfetch("admin_orderadder.htm");

?>